<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateDeliveryDetailsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('delivery_details', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->bigInteger('delivery_id')->comment('发货单ID');
            $table->bigInteger('goods_id')->comment('产品ID');
            $table->bigInteger('sku_id')->default(0)->comment('货品ID');
            $table->string('goods_name', 255)->comment('商品名称');
            $table->integer('num')->default(1)->comment('发货数量');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('delivery_details');
    }
}
